import java.util.function.Supplier;

/**
 * @ClassName Demo01
 * @Description Supplier 接口
 * @Author Li
 * @Date 2022/8/14 15:09
 * @ModifyDate 2022/8/14 15:09
 * @Version 1.0
 */
public class Demo01 {
    private static String getString(Supplier<String> sup) {
        return sup.get();
    }

    public static void main(String[] args) {
        String str1 = "Hello";
        String str2 = "World";
        System.out.println(getString(() -> str1 + str2));
    }
}
